/*!
 * \file GapStateConnected.h
 * \brief State where connection between MGW and SGW is established
 */

#ifndef SGW_GAP_STATE_CONNECTED_H
#define SGW_GAP_STATE_CONNECTED_H

#include "GapStateBase.h"
#include "GapGenerator.h"

namespace tsc
{
namespace sgw
{

/**
 * Connected state of GapGenerator.
 * Connection with MGW is established
 */
class GapStateConnected : public GapStateBase
{
public:

	static GapStateConnected* instance();

    /**
     * Checks if transmission to MGW associated with this generator
     * is possible in this state
     */
    bool txEnabled() const;

protected:

	virtual ~GapStateConnected();

    virtual void handleEventGapT823Expired(
            GapGenerator* gapGen,
            GapEventT823Expired* event,
            EventData*& eventData);

    virtual void handleEventGapMediaTransmissionFinishedInd(
            GapGenerator* gapGen,
            GapEventMediaTransmissionFinishedInd* event,
            EventData*& eventData);

    virtual void handleEventGapMediaBearerSetupCfm(
            GapGenerator* gapGen,
            GapEventMediaBearerSetupCfm* event,
            EventData*& eventData);

    virtual void handleEventGapMediaBearerSetupRej(
            GapGenerator* gapGen,
            GapEventMediaBearerSetupRej* event,
            EventData*& eventData);

private:
	GapStateConnected();

};

} // namespace sgw
} // namespace tsc

#endif // SGW_GAP_STATE_CONNECTED_H
